// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  rcn_c_union_define.h
// Project line  :  K3
// Department    :  K3
// Author        :  Huawei
// Version       :  V100
// Date          :  2015/4/10
// Description   :  HiVcodecV100 VDEC
// Others        :  Generated automatically by nManager V4.2 
// History       :  Huawei 2018/04/10 10:02:40 Create file
// ******************************************************************************

#ifndef __RCN_C_UNION_DEFINE_H__
#define __RCN_C_UNION_DEFINE_H__

/* Define the union U_RCN_PIC_PARA */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_0          : 22  ; /* [31:10] */
        unsigned int    first_mb_inslc : 1  ; /* [9] */
        unsigned int    rcn_cnstrn_prd : 1  ; /* [8] */
        unsigned int    rcn_slc_type   : 2  ; /* [7:6] */
        unsigned int    avs_code_type  : 2  ; /* [5:4] */
        unsigned int    pic_type       : 2  ; /* [3:2] */
        unsigned int    weight_flag    : 2  ; /* [1:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_PIC_PARA;

/* Define the union U_RCN_MB_PARA_0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rcn_fld_prd             : 1  ; /* [31] */
        unsigned int    transform_size_8x8_flag : 1  ; /* [30] */
        unsigned int    mb_type_sc              : 6  ; /* [29:24] */
        unsigned int    rsv_1                   : 2  ; /* [23:22] */
        unsigned int    rcn_mby                 : 10  ; /* [21:12] */
        unsigned int    rsv_2                   : 2  ; /* [11:10] */
        unsigned int    rcn_mbx                 : 10  ; /* [9:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_MB_PARA_0;

/* Define the union U_RCN_MB_PARA_1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_3         : 9  ; /* [31:23] */
        unsigned int    rcn_slc_wght  : 1  ; /* [22] */
        unsigned int    rcn_mb_wght   : 1  ; /* [21] */
        unsigned int    rcn_wght_pred : 1  ; /* [20] */
        unsigned int    rsv_4         : 2  ; /* [19:18] */
        unsigned int    rcn_l16_mod   : 2  ; /* [17:16] */
        unsigned int    rsv_5         : 2  ; /* [15:14] */
        unsigned int    rcn_cbcr_mod  : 2  ; /* [13:12] */
        unsigned int    rcn_mbav      : 12  ; /* [11:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_MB_PARA_1;

/* Define the union U_RCN_MB_PARA_2 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rcn_l4_mod[31:0] : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_MB_PARA_2;

/* Define the union U_RCN_MB_PARA_3 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rcn_l4_mod[63:32] : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_MB_PARA_3;

/* Define the union U_RCN_MB_PARA_4 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_6      : 12  ; /* [31:20] */
        unsigned int    rcn_prd_c0 : 8  ; /* [19:12] */
        unsigned int    rsv_7      : 2  ; /* [11:10] */
        unsigned int    mv_mod_pmv : 2  ; /* [9:8] */
        unsigned int    rcn_prd_l0 : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_MB_PARA_4;

/* Define the union U_RCN_MB_PARA_5 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    tu_size_cfg[11:0] : 12  ; /* [31:20] */
        unsigned int    rcn_prd_c1        : 8  ; /* [19:12] */
        unsigned int    rsv_8             : 4  ; /* [11:8] */
        unsigned int    rcn_prd_l1        : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_MB_PARA_5;

/* Define the union U_RCN_MB_PARA_6 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    pred_type[7:0] : 8  ; /* [31:24] */
        unsigned int    part_mod[7:0]  : 8  ; /* [23:16] */
        unsigned int    rsv_9          : 1  ; /* [15] */
        unsigned int    ctb_size[2:0]  : 3  ; /* [14:12] */
        unsigned int    bitdepth[7:0]  : 8  ; /* [11:4] */
        unsigned int    rsv_10         : 1  ; /* [3] */
        unsigned int    cur_st_cfg     : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_MB_PARA_6;

/* Define the union U_RCN_BUF_STATE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wbtm_empty          : 1  ; /* [31] */
        unsigned int    rtop_inf_full       : 1  ; /* [30] */
        unsigned int    top_rdy             : 1  ; /* [29] */
        unsigned int    pred_inter_rdy      : 1  ; /* [28] */
        unsigned int    intra_rdy           : 1  ; /* [27] */
        unsigned int    m_rcn_rdy           : 1  ; /* [26] */
        unsigned int    rcn_rdy             : 1  ; /* [25] */
        unsigned int    cbf_flag            : 1  ; /* [24] */
        unsigned int    rcn2itrans_ack      : 1  ; /* [23] */
        unsigned int    rsv_11              : 1  ; /* [22] */
        unsigned int    dblk2rcn_wack       : 1  ; /* [21] */
        unsigned int    rcn2pmv_buffer_full : 1  ; /* [20] */
        unsigned int    rcn_ram_cnt         : 6  ; /* [19:14] */
        unsigned int    rsd_ram_cnt         : 6  ; /* [13:8] */
        unsigned int    rsv_12              : 3  ; /* [7:5] */
        unsigned int    inf_dat_cnt         : 5  ; /* [4:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_BUF_STATE;

/* Define the union U_RCN_MB_NUM */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_13        : 6  ; /* [31:26] */
        unsigned int    rcn_imgheight : 10  ; /* [25:16] */
        unsigned int    rsv_14        : 6  ; /* [15:10] */
        unsigned int    rcn_imgwidth  : 10  ; /* [9:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_MB_NUM;

/* Define the union U_RCN_CTB_NUM */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_15             : 11  ; /* [31:21] */
        unsigned int    ctb_imgheight[8:0] : 9  ; /* [20:12] */
        unsigned int    rsv_16             : 3  ; /* [11:9] */
        unsigned int    ctb_imgwidth       : 9  ; /* [8:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_CTB_NUM;

/* Define the union U_RCN_MB_PART_7 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_17     : 13  ; /* [31:19] */
        unsigned int    rcn_ema    : 3  ; /* [18:16] */
        unsigned int    rcn_l8_mod : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_MB_PART_7;

/* Define the union U_RCN_FSM_STATE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_18        : 3  ; /* [31:29] */
        unsigned int    mb_inf_cnt    : 5  ; /* [28:24] */
        unsigned int    rsv_19        : 2  ; /* [23:22] */
        unsigned int    cur_st_rtop   : 2  ; /* [21:20] */
        unsigned int    rsv_20        : 2  ; /* [19:18] */
        unsigned int    cur_st_wbtm   : 2  ; /* [17:16] */
        unsigned int    rsv_21        : 1  ; /* [15] */
        unsigned int    cur_state     : 3  ; /* [14:12] */
        unsigned int    rsv_22        : 2  ; /* [11:10] */
        unsigned int    wbtm_cur_st   : 2  ; /* [9:8] */
        unsigned int    rsv_23        : 1  ; /* [7] */
        unsigned int    pred_ctrl_cur : 3  ; /* [6:4] */
        unsigned int    rsv_24        : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_FSM_STATE;

/* Define the union U_RCN_PRF_STATE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_25          : 17  ; /* [31:15] */
        unsigned int    store_1_blk_cnt : 7  ; /* [14:8] */
        unsigned int    rsv_26          : 1  ; /* [7] */
        unsigned int    store_0_blk_cnt : 7  ; /* [6:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_PRF_STATE;

/* Define the union U_RCN_VP9_INFO */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_27           : 9  ; /* [31:23] */
        unsigned int    vp9_inf_buf_wpt  : 7  ; /* [22:16] */
        unsigned int    rsv_28           : 1  ; /* [15] */
        unsigned int    vp9_inf_buf_rpt  : 7  ; /* [14:8] */
        unsigned int    rsv_29           : 1  ; /* [7] */
        unsigned int    vp9_inf_data_cnt : 7  ; /* [6:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RCN_VP9_INFO;


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_RCN_PIC_PARA  RCN_PIC_PARA  ; /* 0 */
    volatile U_RCN_MB_PARA_0 RCN_MB_PARA_0 ; /* 4 */
    volatile U_RCN_MB_PARA_1 RCN_MB_PARA_1 ; /* 8 */
    volatile U_RCN_MB_PARA_2 RCN_MB_PARA_2 ; /* C */
    volatile U_RCN_MB_PARA_3 RCN_MB_PARA_3 ; /* 10 */
    volatile U_RCN_MB_PARA_4 RCN_MB_PARA_4 ; /* 14 */
    volatile U_RCN_MB_PARA_5 RCN_MB_PARA_5 ; /* 18 */
    volatile U_RCN_MB_PARA_6 RCN_MB_PARA_6 ; /* 1C */
    volatile U_RCN_BUF_STATE RCN_BUF_STATE ; /* 20 */
    volatile U_RCN_MB_NUM    RCN_MB_NUM    ; /* 24 */
    volatile U_RCN_CTB_NUM   RCN_CTB_NUM   ; /* 28 */
    volatile U_RCN_MB_PART_7 RCN_MB_PART_7 ; /* 2C */
    volatile U_RCN_FSM_STATE RCN_FSM_STATE ; /* 30 */
    volatile U_RCN_PRF_STATE RCN_PRF_STATE ; /* 34 */
    volatile U_RCN_VP9_INFO  RCN_VP9_INFO  ; /* 38 */

} S_rcn_REGS_TYPE;

/* Declare the struct pointor of the module rcn */
extern volatile S_rcn_REGS_TYPE *goprcnAllReg;

/* Declare the functions that set the member value */
int iSetRCN_PIC_PARA_first_mb_inslc(unsigned int ufirst_mb_inslc);
int iSetRCN_PIC_PARA_rcn_cnstrn_prd(unsigned int urcn_cnstrn_prd);
int iSetRCN_PIC_PARA_rcn_slc_type(unsigned int urcn_slc_type);
int iSetRCN_PIC_PARA_avs_code_type(unsigned int uavs_code_type);
int iSetRCN_PIC_PARA_pic_type(unsigned int upic_type);
int iSetRCN_PIC_PARA_weight_flag(unsigned int uweight_flag);
int iSetRCN_MB_PARA_0_rcn_fld_prd(unsigned int urcn_fld_prd);
int iSetRCN_MB_PARA_0_transform_size_8x8_flag(unsigned int utransform_size_8x8_flag);
int iSetRCN_MB_PARA_0_mb_type_sc(unsigned int umb_type_sc);
int iSetRCN_MB_PARA_0_rcn_mby(unsigned int urcn_mby);
int iSetRCN_MB_PARA_0_rcn_mbx(unsigned int urcn_mbx);
int iSetRCN_MB_PARA_1_rcn_slc_wght(unsigned int urcn_slc_wght);
int iSetRCN_MB_PARA_1_rcn_mb_wght(unsigned int urcn_mb_wght);
int iSetRCN_MB_PARA_1_rcn_wght_pred(unsigned int urcn_wght_pred);
int iSetRCN_MB_PARA_1_rcn_l16_mod(unsigned int urcn_l16_mod);
int iSetRCN_MB_PARA_1_rcn_cbcr_mod(unsigned int urcn_cbcr_mod);
int iSetRCN_MB_PARA_1_rcn_mbav(unsigned int urcn_mbav);
int iSetRCN_MB_PARA_2_rcn_l4_mod[31:0](unsigned int urcn_l4_mod[31:0]);
int iSetRCN_MB_PARA_3_rcn_l4_mod[63:32](unsigned int urcn_l4_mod[63:32]);
int iSetRCN_MB_PARA_4_rcn_prd_c0(unsigned int urcn_prd_c0);
int iSetRCN_MB_PARA_4_mv_mod_pmv(unsigned int umv_mod_pmv);
int iSetRCN_MB_PARA_4_rcn_prd_l0(unsigned int urcn_prd_l0);
int iSetRCN_MB_PARA_5_tu_size_cfg[11:0](unsigned int utu_size_cfg[11:0]);
int iSetRCN_MB_PARA_5_rcn_prd_c1(unsigned int urcn_prd_c1);
int iSetRCN_MB_PARA_5_rcn_prd_l1(unsigned int urcn_prd_l1);
int iSetRCN_MB_PARA_6_pred_type[7:0](unsigned int upred_type[7:0]);
int iSetRCN_MB_PARA_6_part_mod[7:0](unsigned int upart_mod[7:0]);
int iSetRCN_MB_PARA_6_ctb_size[2:0](unsigned int uctb_size[2:0]);
int iSetRCN_MB_PARA_6_bitdepth[7:0](unsigned int ubitdepth[7:0]);
int iSetRCN_MB_PARA_6_cur_st_cfg(unsigned int ucur_st_cfg);
int iSetRCN_BUF_STATE_wbtm_empty(unsigned int uwbtm_empty);
int iSetRCN_BUF_STATE_rtop_inf_full(unsigned int urtop_inf_full);
int iSetRCN_BUF_STATE_top_rdy(unsigned int utop_rdy);
int iSetRCN_BUF_STATE_pred_inter_rdy(unsigned int upred_inter_rdy);
int iSetRCN_BUF_STATE_intra_rdy(unsigned int uintra_rdy);
int iSetRCN_BUF_STATE_m_rcn_rdy(unsigned int um_rcn_rdy);
int iSetRCN_BUF_STATE_rcn_rdy(unsigned int urcn_rdy);
int iSetRCN_BUF_STATE_cbf_flag(unsigned int ucbf_flag);
int iSetRCN_BUF_STATE_rcn2itrans_ack(unsigned int urcn2itrans_ack);
int iSetRCN_BUF_STATE_dblk2rcn_wack(unsigned int udblk2rcn_wack);
int iSetRCN_BUF_STATE_rcn2pmv_buffer_full(unsigned int urcn2pmv_buffer_full);
int iSetRCN_BUF_STATE_rcn_ram_cnt(unsigned int urcn_ram_cnt);
int iSetRCN_BUF_STATE_rsd_ram_cnt(unsigned int ursd_ram_cnt);
int iSetRCN_BUF_STATE_inf_dat_cnt(unsigned int uinf_dat_cnt);
int iSetRCN_MB_NUM_rcn_imgheight(unsigned int urcn_imgheight);
int iSetRCN_MB_NUM_rcn_imgwidth(unsigned int urcn_imgwidth);
int iSetRCN_CTB_NUM_ctb_imgheight[8:0](unsigned int uctb_imgheight[8:0]);
int iSetRCN_CTB_NUM_ctb_imgwidth(unsigned int uctb_imgwidth);
int iSetRCN_MB_PART_7_rcn_ema(unsigned int urcn_ema);
int iSetRCN_MB_PART_7_rcn_l8_mod(unsigned int urcn_l8_mod);
int iSetRCN_FSM_STATE_mb_inf_cnt(unsigned int umb_inf_cnt);
int iSetRCN_FSM_STATE_cur_st_rtop(unsigned int ucur_st_rtop);
int iSetRCN_FSM_STATE_cur_st_wbtm(unsigned int ucur_st_wbtm);
int iSetRCN_FSM_STATE_cur_state(unsigned int ucur_state);
int iSetRCN_FSM_STATE_wbtm_cur_st(unsigned int uwbtm_cur_st);
int iSetRCN_FSM_STATE_pred_ctrl_cur(unsigned int upred_ctrl_cur);
int iSetRCN_PRF_STATE_store_1_blk_cnt(unsigned int ustore_1_blk_cnt);
int iSetRCN_PRF_STATE_store_0_blk_cnt(unsigned int ustore_0_blk_cnt);
int iSetRCN_VP9_INFO_vp9_inf_buf_wpt(unsigned int uvp9_inf_buf_wpt);
int iSetRCN_VP9_INFO_vp9_inf_buf_rpt(unsigned int uvp9_inf_buf_rpt);
int iSetRCN_VP9_INFO_vp9_inf_data_cnt(unsigned int uvp9_inf_data_cnt);

#endif // __RCN_C_UNION_DEFINE_H__
